require 'rubygems'
require 'gosu'
require 'player'

class BuzzKill < Gosu::Window
  def initialize
    super 640, 480, false
    self.caption = "BuzzKill"
    @hero = Player.new(self)
  end

  def update
    if button_down? Gosu::KbLeft or button_down? Gosu::GpLeft then
      @hero.move_left
    end
    if button_down? Gosu::KbRight or button_down? Gosu::GpRight then
      @hero.move_right
    end
    if button_down? Gosu::KbUp or button_down? Gosu::GpUp then
      @hero.move_up
    end
    if button_down? Gosu::KbDown or button_down? Gosu::GpDown then
      @hero.move_down
    end
  end

  def draw
    @hero.image.draw_rot(@hero.x, @hero.y, 1, 0.0)
  end
end

window = BuzzKill.new
window.show
